package com.my.test.aop.advice;

import org.aopalliance.intercept.MethodInvocation;
import org.springframework.aop.support.DelegatingIntroductionInterceptor;
import org.springframework.stereotype.Component;

import com.my.test.aop.Apology;

/**
 * 用XML的方式来实现引入增强
 * @author Administrator
 *
 */
// 实现了Apology接口
@Component
public class GreetingIntroAdvice extends DelegatingIntroductionInterceptor
		implements Apology {

	@Override
	public Object invoke(MethodInvocation invocation) throws Throwable {
		//System.out.println("GreetingIntroAdvice.invoke()");
		return super.invoke(invocation);
		//return null;
	}

	@Override
	public void saySorry(String name) {
		System.out.println("Sorry! " + name);
	}
}